<?php

 /**
  * @package JooS
  * @subpackage Synax_PHPackager
  */

  require_once "JooS/Syntax/Complex/Transition.php";

  class JooS_Syntax_PHPackager_Array_Syntax extends JooS_Syntax_Complex_Transition {
    /**
     * @return JooS_Syntax_Complex_Concatenate
     */
    public function createRule() {
      $parser = $this->getParser();
      
      return $parser->createSyntax("Complex_Concatenate", array(
        $parser->createSyntax("Simple_Symbol", "array"),
        $parser->createSyntax("Common_Whitespace"),
          
        $parser->createSyntax("Simple_Symbol", "("),
        $parser->createSyntax("Common_Whitespace"),

        $parser->createSyntax("Complex_Repetition", $parser->createSyntax("Complex_Concatenate", array(
          $parser->createSyntax("PHPackager_Array_Item"),
          $parser->createSyntax("Complex_Repetition", $parser->createSyntax("Complex_Concatenate", array(
            $parser->createSyntax("Common_Whitespace"),
            $parser->createSyntax("Simple_Symbol", ","),
            $parser->createSyntax("Common_Whitespace"),
            $parser->createSyntax("PHPackager_Array_Item"),
          )))
        ))),
          
        $parser->createSyntax("Common_Whitespace"),
        $parser->createSyntax("Simple_Symbol", ")"),
      ));
    }
  }
